package com.ajaxjs.cms.service;

import java.util.Date;
import java.util.Map;

import com.ajaxjs.cms.dao.HrDao;
import com.ajaxjs.framework.dao.QueryParams;
import com.ajaxjs.framework.model.PageResult;
import com.ajaxjs.framework.service.BaseDaoService;
import com.ajaxjs.framework.service.IService;

public class HrService extends BaseDaoService<Map<String, Object>, Long, HrDao>
		implements IService<Map<String, Object>, Long> {
	public HrService() {
		setName("hr");
		setUiName("招聘");
		initDao(HrDao.class);
	}

	@Override
	public Map<String, Object> findById(Long id) {
		return getDao().findById(id);
	}

	@Override
	public Long create(Map<String, Object> map) {
		// 业务逻辑的一个例子
		map.put("createDate", new Date());
		map.put("updateDate", new Date());

		return getDao().create(map);
	}

	@Override
	public int update(Map<String, Object> map) {
		map.put("updateDate", new Date());
		return getDao().update(map);
	}

	@Override
	public boolean delete(Map<String, Object> map) {
		return getDao().delete(map);
	}

	@Override
	public PageResult<Map<String, Object>> findPagedList(QueryParams parame) {
		return getDao().findPagedList(parame);
	}
}